package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the image database table.
 * 
 */
@Entity
@NamedQuery(name="Image.findAll", query="SELECT i FROM Image i")
public class Image implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="id_image")
	private int idImage;

	private String path;

	private String title;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="id_author")
	private User user;

	//bi-directional many-to-many association to Categorie
	@ManyToMany
	@JoinTable(
		name="image_categories"
		, joinColumns={
			@JoinColumn(name="id_image")
			}
		, inverseJoinColumns={
			@JoinColumn(name="id_categorie")
			}
		)
	private List<Categorie> categories;

	public Image() {
	}

	public int getIdImage() {
		return this.idImage;
	}

	public void setIdImage(int idImage) {
		this.idImage = idImage;
	}

	public String getPath() {
		return this.path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Categorie> getCategories() {
		return this.categories;
	}

	public void setCategories(List<Categorie> categories) {
		this.categories = categories;
	}

}